package com.jims.master.common.utils;

import com.baomidou.kisso.my.controller.BaseController;
import com.jims.master.common.data.Message;
import com.jims.master.modules.sys.service.DictService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by Administrator on 2017/11/16 0016.
 */
@RestController
@RequestMapping(value = "/dict")
public class DictUtils extends BaseController {
    @Autowired
    private DictService dictService;
    /**
      * @Title:
      * @Description: 字典翻译
      * @param type
      * @param value
      * @return
      * @author CT
      * @date 2017/11/28 0017
      * @throws
     */
    @RequestMapping(value = "/dict",method ={RequestMethod.GET,RequestMethod.POST})
    public String dictV100(@RequestParam(required = true)String type,@RequestParam(required = true)String value){
	/*	Map<String, Object> map = new HashMap<String, Object>();*/
		/*map.put("registList",registList);*/
        String label = dictService.getDictName(type,value);
        Message mes = new Message();
        mes.setData(label);
        return SecurityUtil.encryptMsgData(mes);
    }
}
